package com.vincce.fitness.mappers.mgt;
import com.vincce.fitness.core.base.MyBatisRepository;
import com.vincce.fitness.entity.Resource;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: lenovo
 * Date: 13-4-22
 * Time: 下午5:03
 * To change this template use File | Settings | File Templates.
 */
@MyBatisRepository
public interface ResourceMapper {
    /**查询用户所拥有的资源 **/
    public List<Resource> findResourceByAdminId(Map<String, Integer> map);

    public List<Resource> findAll();










    /**根据id查询子资源 **/
    public List<Resource> findResourceByPid(Integer parentId);
    public void addResource(Resource resource);

    public void updateResource(Resource resource);

    public void deleteResource(Integer id);
    /**根据角色获取树节点**/
    public List<Resource> getResourceByRole(Map<String, Integer> map);
    /**根据角色获取拥有资源Id**/
    public List<Integer> findResIds(Integer roleId);
    /**根据名称获取资源Id**/
    public Integer findResByName(String name);

    public Integer findParentId(Integer resourceId);

}
